package com.example.maybeaccount.Mode;

import java.io.Serializable;

/**
 * 账户类，存放账户信息
 */
public class Account implements Serializable {
    //账户类

    //账户名
    private String name;
    //账户类别
    private String classification;
    //账户余额
    private double asset = 0;
    //备注信息
    private String remark;
    private double expend = 0;
    private double income = 0;
    private int id;


    public Account(String name, String classification, Double amount,String remark){
        this.setName(name);
        this.setClassification(classification);
        this.setAsset(amount);
        this.setRemark(remark);
    }

    public void updateData(double change){
        asset += change;
        if(change >= 0){
            income += change;
        }else{
            expend += Math.abs(change);
        }
    }

    public void changeExpend(double change){
        this.expend += change;
    }

    public void changeIncome(double change){
        this.income += change;
    }

    public void setAsset(double asset) {
        this.asset = asset;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setClassification(String classification) {
        this.classification = classification;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void setIncome(double income) {
        this.income = income;
    }

    public void setExpend(double expend) {
        this.expend = expend;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getAsset() {
        return asset;
    }

    public String getClassification() {
        return classification;
    }

    public String getName() {
        return name;
    }

    public String getRemark() {
        return remark;
    }

    public double getExpend() {
        return expend;
    }

    public double getIncome() {
        return income;
    }

    public int getId() {
        return id;
    }


}
